package com.zjtobacco.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zjtobacco.dao.BaseDao;
import com.zjtobacco.dao.FloorDao;
import com.zjtobacco.domain.Floor;
import com.zjtobacco.domain.Region;
import com.zjtobacco.service.FloorService;
import com.zjtobacco.service.RegionService;
@Service
public class FloorServiceImpl extends BaseServiceImpl<Floor, Integer>
		implements FloorService {

	@Autowired
	private FloorDao warehouseDao;
	@Autowired
	private RegionService regionService;

	@Override
	public BaseDao<Floor, Integer> getDao() {
		return warehouseDao;
	}
	@Override
	public void fillDetail(Floor floor) throws Exception {
		Region region = this.regionService.get(floor.getRegionId());
		floor.setRegionName(region.getName());
		floor.setWarehouseName(region.getWarehouseName());
	}

}
